package com.mlethe.android.demo.seattable.adapter;

import androidx.annotation.NonNull;

import com.mlethe.android.demo.R;
import com.mlethe.library.recyclerview.adapter.BaseQuickAdapter;
import com.mlethe.library.recyclerview.viewholder.ViewHolder;
import com.mlethe.library.widget.seattable.Seat;

public class SeatAdapter extends BaseQuickAdapter<Seat> {
  private double mPrice;
  public SeatAdapter() {
    super(R.layout.item_ticket);
  }

  public void setPrice(double price) {
    this.mPrice = price;
  }

  @Override
  protected void convert(@NonNull ViewHolder holder, Seat item, int position) {
    holder.setText(R.id.ticket_position_tv, item.getRow() + "排" + item.getColumn() + "座")
            .setText(R.id.ticket_price_tv, String.format(getContext().getString(R.string.price), mPrice));
  }
}
